home *** CD-ROM | disk | FTP | other *** search
- ' BSetStat.Bas
- ' Portions Copyright 1987-1990 Microsoft Corp.
- DEFINT A-Z
- SUB ButtonSetState (handle, state)
-
- button = FindButton(handle)
- windo = WindowCurrent
-
- ' =======================================================================
- ' If valid state for the type of button, assign the new state, and re-show
- ' =======================================================================
-
- IF button > 0 AND windo > 0 THEN
- SELECT CASE GloButton(button).buttonType
- CASE 1
- IF state >= 1 AND state <= 3 THEN
- GloButton(button).state = state
- END IF
- CASE 2, 3
- IF state = 1 OR state = 2 THEN
- GloButton(button).state = state
- END IF
- CASE 4, 5
- IF GloButton(button).buttonType = 5 THEN
- IF state >= 1 AND state <= 3 THEN
- GloButton(button).state = state
- END IF
- END IF
- CASE 6
- IF state <> GloButton(button).state THEN
- MouseHide
- COLOR 0, 7
- LOCATE GloWindow(windo).row1 _
- + GloButton(button).row1 - 1 _
- + GloButton(button).state, _
- GloWindow(windo).col1 + GloButton(button).col1 - 1
- PRINT CHR$(176);
- GloButton(button).state = state
- LOCATE GloWindow(windo).row1 _
- + GloButton(button).row1 - 1 _
- + GloButton(button).state, _
- GloWindow(windo).col1 + GloButton(button).col1 - 1
- PRINT CHR$(219);
- MouseShow
- END IF
- CASE 7
- IF state <> GloButton(button).state THEN
- MouseHide
- COLOR 0, 7
- LOCATE GloWindow(windo).row1 _
- + GloButton(button).row1 - 1, _
- GloWindow(windo).col1 _
- + GloButton(button).col1 - 1 _
- + GloButton(button).state
- PRINT CHR$(176);
- GloButton(button).state = state
- LOCATE GloWindow(windo).row1 _
- + GloButton(button).row1 - 1, _
- GloWindow(windo).col1 _
- + GloButton(button).col1 - 1 _
- + GloButton(button).state
- PRINT CHR$(219);
- MouseShow
- END IF
- CASE ELSE
- END SELECT
- END IF
-
- ButtonShow handle
- END SUB